import request from '@/utils/request'

/**
 * 获取月卡列表
 */
export const getMonthlAPI = (params) => request.get('/parking/card/list', { params })

/**
 * 新增月卡
 */
export const createCardAPI = (data) => {
  return request.post('/parking/card', data)
}

/**
 * 获取月卡详情
 */
export const getCardDetailAPI = (id) => {
  return request.get(`/parking/card/detail/${id}`)
}

/**
 * 更新月卡
 * @param {*} data
 * @returns
 */
export const updateCardAPI = (data) => {
  return request.put('/parking/card/edit', data)
}

/**
 * 删除月卡
 */
export function delCardAPI(id) {
  return request.delete(`/parking/card/${id}`)
}

/**
 * 批量删除月卡
 */
export function delAllCardAPI(ids) {
  return request.delete(`/parking/card/${ids.join(',')}`)
}

